home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / wsc4d21.zip / WSC32.PAS < prev    next >
Pascal/Delphi Source File  |  1997-06-05  |  4KB  |  116 lines

  1. unit wsc;
  2.  
  3. interface
  4.  
  5. const
  6.    (* COMM Ports *)
  7.    COM1 = 0;
  8.    COM2 = 1;
  9.    COM3 = 2;
  10.    COM4 = 3;
  11.    COM5 = 4;
  12.    COM6 = 5;
  13.    COM7 = 6;
  14.    COM8 = 7;
  15.    COM9 = 8;
  16.    (* Baud Rate Codes *)
  17.    Baud300  = 0;
  18.    Baud600  = 1;
  19.    Baud1200 = 2;
  20.    Baud2400 = 3;
  21.    Baud4800 = 4;
  22.    Baud9600 = 5;
  23.    Baud19200  = 6;
  24.    Baud38400  = 7;
  25.    Baud57600  = 8;
  26.    Baud115200 = 9;
  27.    (* Parity Codes *)
  28.    NoParity    = 0;
  29.    OddParity   = 1;
  30.    EvenParity  = 2;
  31.    MarkParity  = 3;
  32.    SpaceParity = 4;
  33.    (* Stop Bit Codes *)
  34.    OneStopBit  = 0;
  35.    TwoStopBits = 2;
  36.    (* Word Length Codes *)
  37.    WordLength5 = 5;
  38.    WordLength6 = 6;
  39.    WordLength7 = 7;
  40.    WordLength8 = 8;
  41.    (* WSC errors *)
  42.    WSC_NO_DATA  = -100;
  43.    WSC_RANGE    = -101;
  44.    WSC_ABORTED  = -102;
  45.    WSC_WIN32ERR = -103;
  46.    WSC_EXPIRED  = -104;
  47.    (* Windows comm errors *)
  48.    IE_BADID      = -1;
  49.    IE_OPEN       = -2;
  50.    IE_NOPEN      = -3;
  51.    IE_MEMORY     = -4;
  52.    IE_DEFAULT    = -5;
  53.    IE_HARDWARE   = -10;
  54.    IE_BYTESIZE   = -11;
  55.    IE_BAUDRATE   = -12;
  56.    (* SioGetError masks *)
  57.    WSC_RXOVER   = $0001;
  58.    WSC_OVERRUN  = $0002;
  59.    WSC_PARITY   = $0004;
  60.    WSC_FRAME    = $0008;
  61.    WSC_BREAK    = $0010;
  62.    WSC_TXFULL   = $0100;
  63.  
  64.  function SioBaud(Port, BaudCode : Integer) : Integer; stdcall
  65.  function SioCTS(Port : Integer) : Integer; stdcall
  66.  function SioDCD(Port : Integer) : Integer; stdcall
  67.  function SioDebug(Cmd : Integer) : Integer; stdcall
  68.  function SioDone(Port : Integer) : Integer; stdcall
  69.  function SioDSR(Port : Integer) : Integer; stdcall
  70.  function SioDTR(Port : Integer; Cmd : Char) : Integer; stdcall
  71.  function SioFlow(Port: Integer; Cmd : Char) : Integer; stdcall
  72.  function SioGetc(Port: Integer) : Integer; stdcall
  73.  function SioGets(Port: Integer; Buffer : PChar; Size : Word) : Integer; stdcall
  74.  function SioInfo(Cmd : Char) : Integer; stdcall
  75.  function SioParms(Port, ParityCode, StopBitsCode, DataBitsCode : Integer) : Integer; stdcall
  76.  function SioPutc(Port : Integer; Ch : Char) : Integer; stdcall
  77.  function SioPuts(Port : Integer; Buffer : PChar; Size : Word) : Integer; stdcall
  78.  function SioRead(Port : Integer; Reg : Integer) : Integer; stdcall
  79.  function SioReset(Port, RxQueSize, TxQueSize : Integer) : Integer; stdcall
  80.  function SioRI(Port : Integer) : Integer; stdcall
  81.  function SioRTS(Port : Integer; Cmd : Char ) : Integer; stdcall
  82.  function SioRxClear(Port : Integer) : Integer; stdcall
  83.  function SioRxQue(Port : Integer) : Integer; stdcall
  84.  function SioStatus(Port : Integer; Mask : Word) : Integer; stdcall
  85.  function SioTxClear(Port : Integer) : Integer; stdcall
  86.  function SioTxQue(Port : Integer) : Integer; stdcall
  87.  function SioWinError(Buffer : PChar; Size : Word) : Integer; stdcall
  88.  
  89. implementation
  90.  
  91.  function SioBaud; external 'WSC32';
  92.  function SioCTS; external 'WSC32';
  93.  function SioDCD; external 'WSC32';
  94.  function SioDebug; external 'WSC32';
  95.  function SioDone; external 'WSC32';
  96.  function SioDSR; external 'WSC32';
  97.  function SioDTR; external 'WSC32';
  98.  function SioFlow; external 'WSC32';
  99.  function SioGetc; external 'WSC32';
  100.  function SioGets; external 'WSC32';
  101.  function SioInfo; external 'WSC32';
  102.  function SioParms; external 'WSC32';
  103.  function SioPutc; external 'WSC32';
  104.  function SioPuts; external 'WSC32';
  105.  function SioRead; external 'WSC32';
  106.  function SioReset ; external 'WSC32';
  107.  function SioRI; external 'WSC32';
  108.  function SioRTS; external 'WSC32';
  109.  function SioRxClear; external 'WSC32';
  110.  function SioRxQue; external 'WSC32';
  111.  function SioStatus; external 'WSC32';
  112.  function SioTxClear; external 'WSC32';
  113.  function SioTxQue; external 'WSC32';
  114.  function SioWinError; external 'WSC32';
  115. end.  
  116.